<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>历史</title>
    <style>
        #app{
            background-color: #d0d5d8;
        }
    </style>

</head>
<body>
<div id="app">
    <table style="text-align: center;border-collapse: collapse" border="1">
        <tr>
            <th>标题</th>
            <th>难度</th>
            <th>成绩</th>
            <th>科目</th>
            <th>标签</th>
            <th>记录时间</th>
            <th></th>
        </tr>
        <tr v-for="history in results">
            <td width="15%">{{history.title}}</td>
            <td width="15%">{{history.level}}</td>
            <td width="15%">{{history.result}}</td>
            <td width="15%">{{history.subject}}</td>
            <td width="15%">{{history.tags}}</td>
            <td width="15%">  {{history.createTime}}</td>
            <td width="10%"><a v-bind:href="'exam.html?examId='+history.examId">再做一遍</a></td>
        </tr>
    </table>

</div>

<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/vue.min.js"></script>
<script type="text/javascript">
    new Vue({
        el:"#app",
        data:{
            results:{}
        },
        mounted:function () {
            let that=this
            $.ajax({
                type:"GET",
                url:"/user/history",
                success:function (result) {
                    that.results=result.data
                }
            })
        }
    })
</script>
</body>
</html>